package com.ysw.spring.api_security.idempotent.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: yu_sw
 * @Description: com.ysw.spring.api_security.idempotent.config
 * @date:2023/3/20 15:08
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
    @Autowired
    CheckIdempotentInterceptor checkIdempotentInterceptor;
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(checkIdempotentInterceptor).addPathPatterns("/repeat/*");
        super.addInterceptors(registry);
    }
}
